package com.cloud.alibaba.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 刘志强
 * @date 2020/11/19 13:21
 */
@RestController
public class WebFluxController {

    @GetMapping("/getList")
    public Flux<String> getList() {
        List<String> list = new ArrayList<>();
        list.add("aaaa");
        list.add("bbbb");
        list.add("ccc");
        return Flux.fromIterable(list).take(2);
    }
}
